import routerMap from './router.map'
import { parseRoutes } from '@/utils/routerUtil'

// 异步路由配置
const routesConfig = [
  'login',
  'root',
  'exp404',
  // {
  //   router: 'exp404',
  //   path: '*',
  //   name: '404'
  // },
  {
    router: 'exp403',
    path: '/403',
    name: '403'
  }
]

const options = {
  routes: parseRoutes(routesConfig, routerMap),
  mode: 'history'
}

// export const rootRouterMap = [
//   {
//     key: '',
//     name: 'index',
//     path: '/',
//     redirect: '/login',
//     title: '首页'
//   }
// ]

// export const constantRouterMap = [
//   {
//     path: 'login',
//     name: 'login',
//     component: () => import(/* webpackChunkName: "user" */ '@/pages/login')
//   },
//   {
//     path: '/404',
//     name: '404',
//     component: () => import(/* webpackChunkName: "user" */ '@/pages/exception/404')
//   },
//   {
//     path: '/403',
//     name: '403',
//     component: () => import(/* webpackChunkName: "user" */ '@/pages/exception/404')
//   }
// ]

// const options = {
//   routes:constantRouterMap.concat(rootRouterMap),
//   mode: 'history'
// }

export default options

